Skip to content

Instantly share code, notes, and snippets.

@Aiyualive
Aiyualive / game-7-window5-scores.txt
Created May 17, 2024 16:28
Scoring for Game 7 Window 5. 17/05 Fri 16:00 UTC - 16:10 UTC
Official Window 5
17/05 Fri 16:00 UTC - 16:10 UTC
Start Time: 16:00:04 UTC
Start Tx: 632L1xg86kdsZXfB6e42bLmudDFMZErh31ML3EwCruu6GDUcESA6EB53d5CHmLbFx7KEQVs2ZGYgJKdLdF1U2aA1
End time: 16:06:32 UTC
End Tx: 2qHd9nqgTsbyh4MSFwgZaffxFAGL2rr4pTA3jgTMNmhkc5yM5gXzJ1gjQAnj4w8DNZd8jmANvf2mFCMgsUBHVU4u
BAO scorings:
@mehmetalikaya-hub
mehmetalikaya-hub / rank.sql
Created June 22, 2021 09:25
RANK() functions in SQL
SELECT CustomerID,ShipVia,ShipAddress, ShippedDate,
RANK() OVER(ORDER BY ShippedDate DESC) AS SIRA
FROM Orders
@simonw
simonw / recover_source_code.md
Last active May 17, 2024 16:45
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@Sharpie
Sharpie / README.md
Last active May 17, 2024 16:42
Metric Scraping Scripts

This gist contains various scripts for scraping metrics. Mostly useful for processing the contents of Puppet Enterprise support bundles:

  • sar2influx.rb: A Ruby script that uses sadf to turn SAR archives into InfluxDB line format. For best results, run from a Linux VM using a recent operating system. Such as Ubuntu 22.04.
  • pdb2influx.sh: A bash script that uses awk and mlr to extract command processing times from puppetdb.log files.
  • top-api-calls.sh: Extracts the 10 most popular API calls from *-access.log along with their median and max duration grouped into 30 minute periods (Puppet $runinterval). Uses awk and mlr.
@Bike
Bike / thingsslimedoes.md
Last active May 17, 2024 16:41
Things slime does

quick survey of swank interfaces in order to see what could be broken out into proper portability libraries or, more optimistically, language extensions.

this is preliminary. i pretty much just went down swank.lisp looking for definterfaces. Some other portability related things are not covered yet.

Encoding/decoding

Babel

  • Encode a Lisp string to an octet vector of its UTF-8 encoding
  • Decode an octet vector of UTF-8 to a Lisp string
@slikts
slikts / react-memo-children.md
Last active May 17, 2024 16:39
Why using the `children` prop makes `React.memo()` not work

nelabs.dev

Why using the children prop makes React.memo() not work

I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:

const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing